import React, { useState } from 'react';
import ReactDOM from 'react-dom/client'
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import { PageMenu } from './components/Menu'
import EnterPage from './pages/EnterPage'
import StrategyPage from './pages/StrategyPage'
import './styles/index.css'

function App() {
  const [state, setState] = useState('主页')

  return (
    <div>
      <Router>
        <PageMenu handleClick={setState}/>
        <Routes>
          <Route path="/" element={<EnterPage state={ state } />} />
          <Route path="/strategy/*" element={<StrategyPage />} />
        </Routes>
      </Router>
    </div>
  );
}

ReactDOM.createRoot(document.getElementById('root')).render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
)
